package com.third.share.umeng.tencent;

import android.app.Activity;

import com.dg.acb.utils.configdata.XXConstants;
import com.third.login.ThirdLoginPlatform;
import com.third.share.ShareData;
import com.third.share.umeng.Defaultcontent;
import com.third.share.umeng.StyleUtil;
import com.third.share.umeng.UMThirdShareBase;
import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.ShareAction;
import com.umeng.socialize.bean.SHARE_MEDIA;

public class UQQhirdShare extends UMThirdShareBase{

	public UQQhirdShare(Activity act) {
		super(act);
		// TODO Auto-generated constructor stub
	}
	
	protected void init(){
		PlatformConfig.setQQZone(XXConstants.appKeyQQ, XXConstants.appSecretQQ);
		mPlatform = ThirdLoginPlatform.QQ;
		mShareMedia = SHARE_MEDIA.QQ;
		mStyleList.add(StyleUtil.IMAGELOCAL);
		mStyleList.add(StyleUtil.IMAGEURL);
		mStyleList.add(StyleUtil.WEB11);
		mStyleList.add(StyleUtil.MUSIC11);
		mStyleList.add(StyleUtil.VIDEO11);
	}
	
	@Override
	public void thirdShare(ShareData shareData) {
		// TODO Auto-generated method stub
	//	shareData.mShareStyle =  StyleUtil.VIDEO11;
		mPlatform = shareData.mThirdSharePlatform;
		if(mPlatform == ThirdLoginPlatform.QQ){
			mShareMedia = SHARE_MEDIA.QQ;
		}else if(mPlatform == ThirdLoginPlatform.QZONE){
			mShareMedia = SHARE_MEDIA.QZONE;
		}else{
			return;
		}
		switch(shareData.mShareStyle){
		    case StyleUtil.MUSIC11:
		    	 new ShareAction(mActivity).withMedia(mMusic)
                 .setPlatform(mShareMedia)
                 .setCallback(mUMThirdShareListener).share();
		    	break;
		    case StyleUtil.VIDEO11:
		    	// new ShareAction(mActivity).withMedia(mVideo)
               //  .setPlatform(mShareMedia)
               //  .setCallback(mUMThirdShareListener).share();
				shareVideo(shareData);
		    	break;
			case StyleUtil.IMAGELOCAL:
				 new ShareAction(mActivity).withMedia(mImagelocal)
                 .setPlatform(mShareMedia)
                 .setCallback(mUMThirdShareListener).share();
				break;
			case StyleUtil.IMAGEURL:
				shareImage(shareData);
				break;
			case StyleUtil.WEB11:
				 new ShareAction(mActivity)
                 .withText(Defaultcontent.text)
                 .withMedia(mWeb)
                 .setPlatform(mShareMedia)
                 .setCallback(mUMThirdShareListener).share();
				break;
			case StyleUtil.TEXT:
				if(mPlatform == ThirdLoginPlatform.QZONE){
					new ShareAction(mActivity).withText(Defaultcontent.text)
							.setPlatform(mShareMedia)
							.setCallback(mUMThirdShareListener).share();
				}
				break;
		}
	}
}
